home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Medal Software 3
/
Gold Medal Software - Volume 3 (Gold Medal) (1994).iso
/
windows
/
misc
/
isisdrdm.arj
/
SETUP.BAK
< prev
next >
Wrap
Text File
|
1993-11-30
|
22KB
|
715 lines
'**************************************************************************
'* ISIS/Draw 1.1 Setup Toolkit
'**************************************************************************
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'
'$INCLUDE 'msregdb.inc'
''Dialog ID's
CONST SetupDrawDrwstartBillboard = 1500
CONST SetupDrawBadPath = 1300
CONST SetupDrawCheckSpace = 1310
CONST SetupDrawCustomInstall = 1320
CONST SetupDrawExitFail = 1330
CONST SetupDrawExitQuit = 1340
CONST SetupDrawExitSuccess = 1350
CONST SetupDrawGetDestPath = 1360
CONST SetupDrawHelp = 1370
CONST SetupDrawInstall = 1380
CONST SetupDrawOverwriteDestFiles = 1390
CONST SetupDrawOverwriteWinFiles = 1400
CONST SetupDrawQuit = 1410
CONST SetupDrawTooBig = 1420
CONST SetupDrawWelcome = 1430
CONST SetupDrawFoundOldHelp = 1600
''Bitmap ID
CONST LOGO = 5
''File Types
CONST DRAWFILES = 1
CONST HELPFILES = 2
CONST SAMPLEFILES = 3
CONST TEMPLFILES = 4
''ERROR Codes
CONST STFFILEIO = 8
GLOBAL DEST$ ''Default destination directory.
GLOBAL HELPDIR$ ''ISIS Help dirrectory.
GLOBAL WINDIR$ ''Windows directory.
GLOBAL WINDRIVE$ ''Windows drive letter.
GLOBAL HELPOPT$ ''Option selection from HELPFILES option dialog.
GLOBAL SAMPLEOPT$ ''Option selection from SAMPLEFILES option dialog.
GLOBAL TEMPLOPT$ ''Option selection from TEMPLFILES option dialog.
''CustInst list symbol names
GLOBAL DRAWNEEDS$ ''Option list costs per drive
GLOBAL HELPNEEDS$
GLOBAL SAMPLENEEDS$
GLOBAL TEMPLNEEDS$
GLOBAL EXTRACOSTS$ ''List of extra costs to add per drive
GLOBAL BIGLIST$ ''List of option files cost calc results (boolean)
GLOBAL DELETEHELP$
GLOBAL SAVECONFIG$
GLOBAL ALLON$
GLOBAL OPTIONSELECTED$
GLOBAL DESTEXIST%
GLOBAL WINEXIST%
''Dialog list symbol names
GLOBAL CHECKSTATES$
GLOBAL STATUSTEXT$
GLOBAL DRIVETEXT$
DECLARE SUB AddSelectedFilesToCopyList (ftype%)
DECLARE SUB AddOptFilesToCopyList (ftype%)
DECLARE SUB RecalcOptFiles (ftype%)
DECLARE SUB RecalcPath
DECLARE SUB SetDriveStatus
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
INIT:
CUIDLL$ = "mscuistf.dll" ''custom user interface dll
HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
SetBitmap CUIDLL$, LOGO
SetTitle "ISIS/Draw 1.1 Setup"
szInf$ = GetSymbolValue("STF_SRCINFPATH")
IF szInf$ = "" THEN
szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
END IF
ReadInfFile szInf$
WINDIR$ = GetWindowsDir()
WINDRIVE$ = MID$(WINDIR$, 1, 1)
DEST$ = WINDRIVE$ + ":\ISIS"
ALLON$ = "YES"
SAVECONFIG$ = "NO"
DELETEHELP$ = "NO"
OPTIONSELECTED$ = "NO"
''CustInst list symbols
CHECKSTATES$ = "CheckItemsState"
STATUSTEXT$ = "StatusItemsText"
DRIVETEXT$ = "DriveStatusText"
FOR i% = 1 TO 4 STEP 1
AddListItem CHECKSTATES$, "ON"
NEXT i%
FOR i% = 1 TO 4 STEP 1
AddListItem STATUSTEXT$, ""
NEXT i%
FOR i% = 1 TO 7 STEP 1
AddListItem DRIVETEXT$, ""
NEXT i%
ReplaceListItem DRIVETEXT$, 7, DEST$
''Disk cost list symbols
DRAWNEEDS$ = "DrawNeeds"
HELPNEEDS$ = "HelpNeeds"
SAMPLENEEDS$ = "SampleNeeds"
TEMPLNEEDS$ = "TemplNeeds"
EXTRACOSTS$ = "ExtraCosts"
BIGLIST$ = "BigList"
FOR i% = 1 TO 4 STEP 1
AddListItem BIGLIST$, ""
NEXT i%
FOR i% = 1 TO 26 STEP 1
AddListItem EXTRACOSTS$, "0"
NEXT i%
''File Option Variables
HELPOPT$ = "1"
SAMPLEOPT$ = "1"
TEMPLOPT$ = "1"
WELCOME:
SetSymbolValue "EditTextIn", DEST$
SetSymbolValue "EditFocus", "END"
WELCOME1:
sz$ = UIStartDlg(CUIDLL$, SetupDrawWelcome, "FEditDlgProc", SetupDrawHelp, HELPPROC$)
IF sz$ = "CONTINUE" THEN
olddest$ = DEST$
DEST$ = GetSymbolValue("EditTextOut")
''Validate new path.
IF IsDirWritable(DEST$) = 0 THEN
GOSUB BADPATH
GOTO WELCOME
END IF
UIPop 1
''Truncate display if too long.
IF LEN(DEST$) > 23 THEN
ReplaceListItem DRIVETEXT$, 7, MID$(DEST$, 1, 23)+"..."
ELSE
ReplaceListItem DRIVETEXT$, 7, DEST$
END IF
''Recalc if path changed.
RecalcPath
SetDriveStatus
''Install only if it will fit.
FOR i% = 1 TO 4 STEP 1
IF GetListItem(BIGLIST$, i%) <> "" THEN
GOSUB TOOBIG
olddest$ = ""
GOTO CUSTINST
END IF
NEXT i%
olddest$ = ""
GOTO CUSTINST
ELSEIF sz$ = "REACTIVATE" THEN
RecalcPath
SetDriveStatus
GOTO WELCOME1
ELSEIF sz$ = "EXIT" THEN
GOSUB ASKQUIT
GOTO WELCOME1
ELSE
UIPop 1
GOTO CUSTINST
END IF
CHECKCFG:
fName$ = GetSectionKeyFilename("DrawFiles", "ISIS/Draw Configuration File")
WINEXIST% = DoesFileExist(MakePath(WINDIR$,fName$),femExists)
DESTEXIST% = DoesFileExist(MakePath(DEST$,fName$),femExists)
IF WINEXIST% = 1 OR DESTEXIST% = 1 THEN
IF WINEXIST% = 1 THEN
sz$ = UIStartDlg(CUIDLL$, SetupDrawOverwriteWinFiles, "FInfoDlgProc", SetupDrawHelp, HELPPROC$)
ELSE
sz$ = UIStartDlg(CUIDLL$, SetupDrawOverwriteDestFiles, "FInfoDlgProc", SetupDrawHelp, HELPPROC$)
END IF
IF sz$ = "CONTINUE" THEN
SAVECONFIG$ = "YES"
UIPop 1
RETURN
ELSEIF sz$ = "BACK" THEN
SAVECONFIG$ = "NO"
UIPop 1
RETURN
ELSE
GOSUB ASKQUIT
GOTO CHECKCFG
ENDIF
ELSE
UIPop 1
RETURN
END IF
CHECKSELECTION:
FOR i% = 1 TO 4 STEP 1
IF GetListItem(CHECKSTATES$, i%) = "ON" THEN
OPTIONSELECTED$ = "YES"
RETURN
END IF
NEXT i%
GOTO QUIT
CHECKHELP:
''Check for old Helps
HELPDIR$ = MakePath(DEST$,"HELP")
HELPDIREXIST% = DoesDirExist(HELPDIR$)
IF HELPDIREXIST% = 1 THEN
sz$ = UIStartDlg(CUIDLL$, SetupDrawFoundOldHelp, "FInfoDlgProc", SetupDrawHelp, HELPPROC$)
IF sz$ = "CONTINUE" THEN
DELETEHELP$ = "YES"
UIPop 1
RETURN
ELSE
UIPopAll
ERROR STFQUIT
END IF
ELSE
UIPop 1
RETURN
END IF
CUSTINST:
sz$ = UIStartDlg(CUIDLL$, SetupDrawCustomInstall, "FCustInstDlgProc", SetupDrawHelp, HELPPROC$)
IF sz$ = "CONTINUE" THEN
''Install only if it will fit.
IF VAL(GetListItem(DRIVETEXT$, 2)) > VAL(GetListItem(DRIVETEXT$, 3)) THEN
GOSUB TOOBIG
GOTO CUSTINST
ELSE
FOR i% = 1 TO 4 STEP 1
IF GetListItem(BIGLIST$, i%) <> "" THEN
GOSUB TOOBIG
GOTO CUSTINST
END IF
NEXT i%
END IF
UIPop 1
GOTO INSTALL
ELSEIF sz$ = "PATH" THEN
UIPop 1
GOSUB GETPATH
GOTO CUSTINST
ELSEIF sz$ = "CHK1" THEN
IF GetListItem(CHECKSTATES$, DRAWFILES) <> "ON" THEN
ALLON$ = "NO"
END IF
RecalcOptFiles DRAWFILES
SetDriveStatus
GOTO CUSTINST
ELSEIF sz$ = "CHK2" THEN
IF GetListItem(CHECKSTATES$, HELPFILES) <> "ON" THEN
ALLON$ = "NO"
END IF
RecalcOptFiles HELPFILES
SetDriveStatus
GOTO CUSTINST
ELSEIF sz$ = "CHK3" THEN
IF GetListItem(CHECKSTATES$, SAMPLEFILES) <> "ON" THEN
ALLON$ = "NO"
END IF
RecalcOptFiles SAMPLEFILES
SetDriveStatus
GOTO CUSTINST
ELSEIF sz$ = "CHK4" THEN
IF GetListItem(CHECKSTATES$, TEMPLFILES) <> "ON" THEN
ALLON$ = "NO"
END IF
RecalcOptFiles TEMPLFILES
SetDriveStatus
GOTO CUSTINST
ELSEIF sz$ = "BTN1" THEN
IF ALLON$ = "NO" THEN
ALLON$ = "YES"
FOR i% = 1 TO 4 STEP 1
ReplaceListItem CHECKSTATES$, i%, "ON"
NEXT i%
RecalcPath
SetDriveStatus
END IF
GOTO CUSTINST
ELSEIF sz$ = "REACTIVATE" THEN
RecalcPath
SetDriveStatus
GOTO CUSTINST
ELSE
GOSUB ASKQUIT
GOTO CUSTINST
END IF
INSTALL:
GOSUB CHECKSELECTION
GOSUB CHECKCFG
IF GetListItem(CHECKSTATES$, HELPFILES) = "ON" THEN
GOSUB CHECKHELP
END IF
ClearCopyList
ClearBillboardList
fTick& = 100
AddToBillboardList CUIDLL$, SetupDrawDrwstartBillboard, "FModelessDlgProc", fTick&
AddOptFilesToCopyList DRAWFILES
AddOptFilesToCopyList HELPFILES
AddOptFilesToCopyList SAMPLEFILES
AddOptFilesToCopyList TEMPLFILES
CreateDir DEST$, cmoNone
CreateDir MakePath(DEST$,"DRWSTART"), cmoNone
IF DELETEHELP$ = "YES" THEN
BASEHLPFILE$ = MakePath(HELPDIR$,"isisbase.hlp")
BASEIMGFILE$ = MakePath(HELPDIR$,"isisbase.img")
DRAWHLPFILE$ = MakePath(HELPDIR$,"isisdraw.hlp")
DRAWIMGFILE$ = MakePath(HELPDIR$,"isisdraw.img")
IF DoesFileExist(DRAWHLPFILE$,femExists) THEN
KILL DRAWHLPFILE$
END IF
IF DoesFileExist(DRAWIMGFILE$,femExists) THEN
KILL DRAWIMGFILE$
END IF
END IF
IF SAVECONFIG$ = "YES" THEN
fName$ = GetSectionKeyFilename("DrawFiles", "ISIS/Draw Configuration File 1")
SPLITPATH fname$, drv$, dir$, filename$, ext$
backupname$ = filename$ + ".sav"
IF WINEXIST% = 1 THEN
tplsavname$ = MakePath(WINDIR$,backupname$)
IF DoesFileExist(tplsavname$,femExists) THEN
KILL tplsavname$
END IF
BackupFile MakePath(WINDIR$,fName$), backupname$
ELSEIF DESTEXIST% = 1 THEN
tplsavname$ = MakePath(DEST$,backupname$)
IF DoesFileExist(tplsavname$,femExists) THEN
KILL tplsavname$
END IF
BackupFile MakePath(DEST$,fName$), backupname$
END IF
fName$ = GetSectionKeyFilename("DrawFiles", "ISIS/Draw Configuration File 2")
SPLITPATH fname$, drv$, dir$, filename$, ext$
backupname$ = filename$ + ".sav"
IF WINEXIST% = 1 THEN
tplsavname$ = MakePath(WINDIR$,backupname$)
IF DoesFileExist(tplsavname$,femExists) THEN
KILL tplsavname$
END IF
BackupFile MakePath(WINDIR$,fName$), backupname$
ELSEIF DESTEXIST% = 1 THEN
tplsavname$ = MakePath(DEST$,backupname$)
IF DoesFileExist(tplsavname$,femExists) THEN
KILL tplsavname$
END IF
BackupFile MakePath(DEST$,fName$), backupname$
END IF
ENDIF
SetCopyGaugePosition 160,30
CopyFilesInCopyList
IF GetListItem(CHECKSTATES$, DRAWFILES) = "ON" THEN
CreateProgmanGroup "ISIS", "", cmoNone
ShowProgmanGroup "ISIS", 1, cmoNone
CreateProgmanItem "ISIS", "ISIS/Draw 1.1", MakePath(DEST$,"isisdraw.exe"), "", cmoOverwrite
CreateRegKeyValue "ISISServer\protocol\StdFileEditing\server", MakePath(DEST$,"ISISDRAW.EXE")
CreateRegKeyValue "ISISServer\protocol\StdFileEditing\verb\0", "Edit"
CreateRegKeyValue "ISISServer", "ISIS/Draw Sketch"
CreateRegKeyValue ".skc", "ISISServer"
END IF
QUIT:
ON ERROR GOTO ERRQUIT
IF ERR = 0 THEN
dlg% = SetupDrawExitSuccess
ELSEIF ERR = STFQUIT OR ERR = STFERR THEN
dlg% = SetupDrawExitQuit
ELSEIF ERR = STFFILEIO THEN
dlg% = SetupDrawExitQuit
ELSE
dlg% = SetupDrawExitFail
'' dlg% = SetupDrawExitQuit
END IF
QUITL1:
sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO QUITL1
END IF
UIPop 1
END
ERRQUIT:
i% = DoMsgBox("Setup sources were corrupted, call MDL Technical Support!", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
END
GETPATH:
SetSymbolValue "EditTextIn", DEST$
SetSymbolValue "EditFocus", "END"
GETPATHL1:
sz$ = UIStartDlg(CUIDLL$, SetupDrawGetDestPath, "FEditDlgProc", SetupDrawHelp, HELPPROC$)
IF sz$ = "CONTINUE" THEN
olddest$ = DEST$
DEST$ = GetSymbolValue("EditTextOut")
''Validate new path.
IF IsDirWritable(DEST$) = 0 THEN
GOSUB BADPATH
GOTO GETPATH
END IF
UIPop 1
''Truncate display if too long.
IF LEN(DEST$) > 23 THEN
ReplaceListItem DRIVETEXT$, 7, MID$(DEST$, 1, 23)+"..."
ELSE
ReplaceListItem DRIVETEXT$, 7, DEST$
END IF
''Recalc if path changed.
IF (olddest$ <> DEST$) AND (olddest$ <> DEST$+"\") AND (olddest$+"\" <> DEST$) THEN
sz$ = UIStartDlg(CUIDLL$, SetupDrawCheckSpace, "FModelessDlgProc", 0, "")
RecalcPath
SetDriveStatus
''Install only if it will fit.
FOR i% = 1 TO 4 STEP 1
IF GetListItem(BIGLIST$, i%) <> "" THEN
GOSUB TOOBIG
GOTO GETPATHL1
END IF
NEXT i%
UIPop 1
END IF
olddest$ = ""
RETURN
ELSEIF sz$ = "REACTIVATE" THEN
RecalcPath
SetDriveStatus
GOTO GETPATHL1
ELSEIF sz$ = "EXIT" THEN
GOSUB ASKQUIT
GOTO GETPATHL1
ELSE
IF olddest$ <> "" THEN
DEST$ = olddest$
END IF
UIPop 1
RETURN
END IF
TOOBIG:
sz$ = UIStartDlg(CUIDLL$, SetupDrawTooBig, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
RecalcPath
SetDriveStatus
GOTO TOOBIG
END IF
UIPop 1
RETURN
BADPATH:
sz$ = UIStartDlg(CUIDLL$, SetupDrawBadPath, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
RecalcPath
SetDriveStatus
GOTO BADPATH
END IF
UIPop 1
RETURN
ASKQUIT:
sz$ = UIStartDlg(CUIDLL$, SetupDrawQuit, "FQuitDlgProc", 0, "")
IF sz$ = "EXIT" THEN
UIPopAll
ERROR STFQUIT
ELSEIF sz$ = "REACTIVATE" THEN
GOTO ASKQUIT
ELSE
UIPop 1
END IF
RETURN
'**
'** Purpose:
'** Adds the PL option files to the copy list.
'** Arguments:
'** ftype% - type of files to add, one of the following:
'** PLFILES
'** Returns:
'** none.
'*************************************************************************
SUB AddSelectedFilesToCopyList (ftype%) STATIC
IF GetListItem(CHECKSTATES$, ftype%) = "ON" THEN
SrcDir$ = GetSymbolValue("STF_SRCDIR")
IF ftype% = PLFILES THEN
lLen% = GetListLength(LISTOUT$)
PlDest$ = MakePath (DEST$, "DRWSTART")
FOR i% = 1 TO lLen% STEP 1
fName$ = GetListItem(LISTOUT$, i%)
AddSectionKeyFileToCopyList "PlFiles", fName$ , SrcDir$, PlDest$
NEXT i%
END IF
SrcDir$ = ""
END IF
END SUB
'**
'** Purpose:
'** Adds the specified option files to the copy list.
'** Arguments:
'** ftype% - type of files to add, one of the following:
'** DRAWFILES, HELPFILES, PLFILES, SAMPLEFILES, TEMPLFILES
'** Returns:
'** none.
'*************************************************************************
SUB AddOptFilesToCopyList (ftype%) STATIC
IF GetListItem(CHECKSTATES$, ftype%) = "ON" THEN
SrcDir$ = GetSymbolValue("STF_SRCDIR")
IF ftype% = DRAWFILES THEN
AddSectionKeyFileToCopyList "DrawFiles", "ISIS/Draw Executable", SrcDir$, DEST$
'* AddSectionKeyFileToCopyList "DrawFiles", "ISIS/Draw Support Files", SrcDir$, DEST$
IF DESTEXIST% = 1 AND WINEXIST% = 0 THEN
AddSectionKeyFileToCopyList "DrawFiles", "ISIS/Draw Configuration File 1", SrcDir$, DEST$
ELSE
AddSectionKeyFileToCopyList "DrawFiles", "ISIS/Draw Configuration File 1", SrcDir$, WINDIR$
END IF
IF DESTEXIST% = 1 AND WINEXIST% = 0 THEN
AddSectionKeyFileToCopyList "DrawFiles", "ISIS/Draw Configuration File 2", SrcDir$, DEST$
ELSE
AddSectionKeyFileToCopyList "DrawFiles", "ISIS/Draw Configuration File 2", SrcDir$, WINDIR$
END IF
ELSEIF ftype% = HELPFILES THEN
AddSectionFilesToCopyList "HelpFiles", SrcDir$, DEST$
ELSEIF ftype% = SAMPLEFILES THEN
AddSectionFilesToCopyList "SampleFiles", SrcDir$, DEST$
ELSEIF ftype% = TEMPLFILES THEN
AddSectionFilesToCopyList "TemplFiles", SrcDir$, DEST$
END IF
SrcDir$ = ""
END IF
END SUB
'**
'** Purpose:
'** Recalculates disk space for the given option files and sets
'** the status info symbol "StatusItemsText".
'** Arguments:
'** ftype% - type of files to add, one of the following:
'** DRAWFILES, HELPFILES, PLFILES, SAMPLEFILES
'** Returns:
'** none.
'*************************************************************************
SUB RecalcOptFiles (ftype%) STATIC
CursorSave% = ShowWaitCursor()
ClearCopyList
AddOptFilesToCopyList ftype%
fExtra% = 0
IF ftype% = DRAWFILES THEN
ListSym$ = DRAWNEEDS$
IF GetListItem(CHECKSTATES$, DRAWFILES) = "ON" THEN
''Add extra cost to Windows drive for ini/progman, etc.
ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
ReplaceListItem EXTRACOSTS$, ndrive%, "4096"
fExtra% = 1
END IF
ELSEIF ftype% = HELPFILES THEN
ListSym$ = HELPNEEDS$
ELSEIF ftype% = SAMPLEFILES THEN
ListSym$ = SAMPLENEEDS$
ELSEIF ftype% = TEMPLFILES THEN
ListSym$ = TEMPLNEEDS$
END IF
StillNeed& = GetCopyListCost(EXTRACOSTS$, ListSym$, "")
cost& = 0
FOR i% = 1 TO 26 STEP 1
cost& = cost& + VAL(GetListItem(ListSym$, i%))
NEXT i%
ReplaceListItem STATUSTEXT$, ftype%, STR$(cost& / 1024) + " K"
IF StillNeed& > 0 THEN
ReplaceListItem BIGLIST$, ftype%, "YES"
ELSE
ReplaceListItem BIGLIST$, ftype%, ""
END IF
IF fExtra% THEN
ReplaceListItem EXTRACOSTS$, ndrive%, "0"
END IF
RestoreCursor CursorSave%
ListSym$ = ""
END SUB
'**
'** Purpose:
'** Recalculates disk space and sets option status info according
'** to the current destination path.
'** Arguments:
'** none.
'** Returns:
'** none.
'*************************************************************************
SUB RecalcPath STATIC
CursorSave% = ShowWaitCursor()
RecalcOptFiles DRAWFILES
RecalcOptFiles HELPFILES
RecalcOptFiles SAMPLEFILES
RecalcOptFiles TEMPLFILES
RestoreCursor CursorSave%
END SUB
'**
'** Purpose:
'** Sets drive status info according to latest disk space calcs.
'** Arguments:
'** none.
'** Returns:
'** none.
'*************************************************************************
SUB SetDriveStatus STATIC
drive$ = MID$(DEST$, 1, 1)
ndrive% = ASC(ucase$(drive$)) - ASC("A") + 1
cost1& = VAL(GetListItem(DRAWNEEDS$, ndrive%)) + VAL(GetListItem(HELPNEEDS$, ndrive%))
cost2& = VAL(GetListItem(SAMPLENEEDS$, ndrive%))
cost3& = VAL(GetListItem(TEMPLNEEDS$, ndrive%))
cost& = cost1& + cost2& + cost3&
free& = GetFreeSpaceForDrive(drive$)
ReplaceListItem DRIVETEXT$, 1, drive$ + ":"
ReplaceListItem DRIVETEXT$, 2, STR$(cost& / 1024) + " K"
ReplaceListItem DRIVETEXT$, 3, STR$(free& / 1024) + " K"
IF drive$ = WINDRIVE$ THEN
ReplaceListItem DRIVETEXT$, 4, ""
ReplaceListItem DRIVETEXT$, 5, ""
ReplaceListItem DRIVETEXT$, 6, ""
ELSE
ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
cost& = VAL(GetListItem(DRAWNEEDS$, ndrive%)) + VAL(GetListItem(HELPNEEDS$, ndrive%)) + VAL(GetListItem(SAMPLENEEDS$, ndrive%)) + VAL(GetListItem(TEMPLNEEDS$, ndrive%))
IF cost& = 0 THEN
ReplaceListItem DRIVETEXT$, 4, ""
ReplaceListItem DRIVETEXT$, 5, ""
ReplaceListItem DRIVETEXT$, 6, ""
ELSE
free& = GetFreeSpaceForDrive(WINDRIVE$)
ReplaceListItem DRIVETEXT$, 4, WINDRIVE$ + ":"
ReplaceListItem DRIVETEXT$, 5, STR$(cost& / 1024) + " K"
ReplaceListItem DRIVETEXT$, 6, STR$(free& / 1024) + " K"
END IF
END IF
END SUB
'**
'** Purpose:
'** Appends a file name to the end of a directory path,
'** inserting a backslash character as needed.
'** Arguments:
'** szDir$ - full directory path (with optional ending "\")
'** szFile$ - filename to append to directory
'** Returns:
'** Resulting fully qualified path name.
'*************************************************************************
FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
IF szDir$ = "" THEN
MakePath = szFile$
ELSEIF szFile$ = "" THEN
MakePath = szDir$
ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
MakePath = szDir$ + szFile$
ELSE
MakePath = szDir$ + "\" + szFile$
END IF
END FUNCTION